package com.hyd.hx_adr.modules.examine.factory;

import org.springframework.context.annotation.Configuration;

import java.util.HashMap;
import java.util.Map;

@Configuration
public class ExamineDateProcessorStrategyFactory {

    private static final Map<String, ExamineDataProcessorStrategy> strategyMap = new HashMap<>();

    static {
        strategyMap.put("1", new ExamineDataProcessorStrategy() {
            @Override
            public String process(String value) {
                return value + "2";
            }
        });
        strategyMap.put("2", new ExamineDataProcessorStrategy() {
            @Override
            public String process(String value) {
                return value + "2";
            }
        });
        strategyMap.put("3", new ExamineDataProcessorStrategy() {
            @Override
            public String process(String value) {
                return value + "3";
            }
        });
    }

    public static ExamineDataProcessorStrategy getStrategy(String processingMethod) {
        return strategyMap.get(processingMethod);
    }

    public static void addStrategy(String processingMethod, ExamineDataProcessorStrategy strategy) {
        strategyMap.put(processingMethod, strategy);
    }

}
